<template>
  <div>
      <FormPanel ref="formPanel" :list="formList" :isSubmitBtn="false" :collapse="false" labelWidth="110" :cols="4" />
    <div style="text-align: center">
      <el-button @click="closeDrawer">关 闭</el-button>
    </div>
  </div>
</template>
<script>
import { dictionary } from '@/utils/dictMixin';

export default {
  name: 'detail',
  mixins: [dictionary],
  props: ['rowData'],

  data() {
    return {
      formList: this.createdFrom(),
    };
  },
  created() {
  },
  mounted() {
    this.init();
  },
  methods: {
    init(){
      this.formList.map(x => {
        x.initialValue = this.rowData[x.fieldName]
      });
    },

    changeHandle(val) {
      // this.saveData = val;
    },
    closeDrawer() {
      this.$emit('close');
    },


    createdFrom() {
      return [
        {
          type: 'INPUT',
          label: '经销商代码',
          fieldName: 'dealerCode',
          initialValue: '',
          placeholder: '',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '经销商名称',
          fieldName: 'dealerName',
          initialValue: '',
          placeholder: '',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '年月',
          fieldName: 'reconciliationDate',
          initialValue: '',
          placeholder: '',
          disabled: true
        },
        {
          type: 'SELECT',
          label: '状态',
          fieldName: 'state',
          disabled: true,
          placeholder: '',
          itemList: this.createDictList('2150')
        },
        {
          type: 'INPUT',
          label: '确认人',
          fieldName: 'confirmBy',
          initialValue: '',
          placeholder: '',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '确认日期',
          fieldName: 'confirmDate',
          initialValue: '',
          placeholder: '',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '整车自有资金余额',
          fieldName: 'ownBalanceAmount',
          initialValue: '',
          placeholder: '',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '整车三方资金余额',
          fieldName: 'threeBalanceAmount',
          initialValue: '',
          placeholder: '',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '整车返利余额',
          fieldName: 'rebateBalanceAmount',
          initialValue: '',
          placeholder: '',
          disabled: true
        },
        {
          type: 'TEXT_AREA',
          label: '备注',
          offsetRightCols: 1,
          maxlength: 600,
          fieldName: 'remark',
          placeholder: '',
          selfCols: 3,
          disabled: true
        },
      ];
    },
  }
};
</script>
